/**
 * Copyright &copy; 2016-2017 <a href="https://www.lczyfz.com">联创智云</a> All rights reserved.
 */
package com.lczyfz.campusinfo.modules.campusinfomodules.web;

import com.lczyfz.campusinfo.common.persistence.Page;
import com.lczyfz.campusinfo.common.utils.ApiResultUtils;
import com.lczyfz.campusinfo.common.web.BaseController;
import com.lczyfz.campusinfo.modules.campusinfomodules.entity.ModuleDetail;
import com.lczyfz.campusinfo.modules.campusinfomodules.service.ModuleDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * 模块Controller
 * @author zms
 * @version 2018-04-10
 */
@Controller
@RequestMapping(value = "api/campusinfomodules/moduleDetail")
public class ModuleApiController extends BaseController {

	@Autowired
	private ModuleDetailService moduleDetailService;
	@RequestMapping(value = "moduleList")
	@ResponseBody
	Map<String, Object> getTrainList(ModuleDetail moduleDetail, HttpServletRequest request, HttpServletResponse response) {
		Page<ModuleDetail> page = moduleDetailService.findPage(new Page<ModuleDetail>(request, response),moduleDetail);
		Map<String, Object> map = ApiResultUtils.getBaseMapSuccess();
		map.put("page", page.getList());
		map.put("pageNo", page.getPageNo());
		map.put("count", page.getCount());
		map.put("totalPage", page.getTotalPage());
		return map;
	}


}